package Terminal.Entity.IceClasses;

import EntityCondivise.ENotificaTaskPrx;
import Ice.Communicator;
import Terminal.Entity.Dominio.ENotificaTask;
import Terminal.TechnicalServices.TSIce;

/**
 * Specializza la classe notifica, infatti comunica al Consulente un avvenimento relativo ad un suo task
 * @author Gruppo 6
 */

public class ENotificaTaskI extends EntityCondivise.ENotificaTask{

	TSIce iceComunicator;
	Communicator ice;
	ENotificaTaskPrx notifica;		
	
	public ENotificaTaskI()
	{
		super();
	
		
		iceComunicator = Terminal.TechnicalServices.TSIce.istanza();
		ice = iceComunicator.getIce();
		
		try 
		{
	        Ice.ObjectPrx base = ice.stringToProxy("SimpleENotificaTaskI:" + iceComunicator.getParametriConnessione());
	        notifica = EntityCondivise.ENotificaTaskPrxHelper.checkedCast(base);
	        
	    	if (notifica == null)
	        {   	
	        	throw new Error("Invalid proxy");
	        }	        
	        
		}
		catch (Ice.LocalException e) 
        {
            e.printStackTrace();
            iceComunicator.setStatus(1);
        } 
		catch (Exception e) 
		{
            System.err.println(e.getMessage());
            iceComunicator.setStatus(1);
        }				
	};
}
